<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    public function getImageAttribute($value)
    {
        return getImageDomain($value);
    }

    public function getBannerAttribute($value)
    {
        return getImageDomain($value);
    }

    // 分类下的商品
    public function products()
    {
       return $this->hasMany(Product::class);
    }
}
